#include <iostream>
using namespace std;
class Point{
friend double Xdis(const Point &p1,const Point &p2);
friend double Ydis(const Point &p1,const Point p2);
	public:
		Point(double x=0,double y=0){
			this->x=x;
			this->y=y;
		}
	private:
		double x;
		double y;
};
double Xdis(const Point &p1,const Point &p2);
double Ydis(const Point &p1,const Point p2);
int main()
{
	Point p1(1,0);
	Point p2(2,0);
	double x=Xdis(p1,p2);
	double y=Ydis(p1,p2);
	cout<<x<<' '<<y;
	return 0;
}
double Xdis(const Point &p1,const Point &p2)
{
	if(p1.x<p2.x){
		return (p2.x-p1.x);
	}else {
	return p1.x-p2.x;
	}
}
double Ydis(const Point &p1,const Point p2)
{
	if(p1.y<p2.y){
		return (p2.y-p1.y);
	}else {
	return p1.y-p2.y;
	}
}
